<template>
<div>


<Row>
    <el-amap class="amap-box" :vid="'amap-vue'"></el-amap>
</Row>


<!-- <Form :model="form" :label-width="80">
    <FormItem label="名称">
        <Input v-model="form.name" style="width:300px;"></Input>
    </FormItem>
    

    <FormItem 
    v-for="(item, index) in headers" :key="index"
    :label="item.title"
    >
        {{item.slot}}
    </FormItem>

    <FormItem>
        <Button type="primary" @click="handleSubmit('formValidate')">提交</Button>
        <Button @click="handleReset('formValidate')" style="margin-left: 8px">Reset</Button>
    </FormItem>
</Form> -->

</div>
</template>

<script>


export default {
	
	name : 'configpage',
	
	data () {
		return {
		  	form : {},

		  	headers : [
                // {
                //     type: 'selection',
                //     width: 60,
                //     align: 'center'
                // },
                {
                    title: '名称',
                    slot: 'name'
                },
                {
                    title: '表头',
                    slot: 'headers',
                },
                // {
                //     title: '操作',
                //     slot: 'action'
                // }
            ],
		}
	},

	props : {

	},

	components : {
		
	},

	computed : {

	},

	methods : {
		handleSubmit () {

			this.headers.unshift({
                type: 'selection',
                width: 60,
                align: 'center'
            });

            this.headers.push({
                title: '操作',
                slot: 'action'
            });

            const obj = {
            	name : this.form.name,
            	headers : JSON.stringify(this.headers),
            };


            this.$http({
				fun : '/v1/pn/api',
				requestType : 'POST',
				...obj,
				service : 'page',
				cb : res => {
					this.$Message.success('操作成功');
				}
			});

            console.log(obj);
		}
	},

	watch : {
	    
	},

	mounted () {
		
	},

}
</script>

<style>
.amap-wrapper {
  width: 500px;
  height: 500px;
}
</style>
